<template>
	<view class="setting-container" :style="{height: `${windowHeight}px`}">
		<view class="menu-list">
			<!-- <view class="list-cell list-cell-arrow" @click="handleUpInfo">
				<view class="menu-item-box">
					<view class="iconfont icon-user menu-icon" style="color: #F6DDA4;"></view>
					<view>{{$t('mine.setting.modifyInfo')}}</view>
				</view>
			</view> -->
			<view class="list-cell list-cell-arrow" @click="handleToPwd">
				<view class="menu-item-box">
					<view class="iconfont icon-password menu-icon" style="color: #F6DDA4;"></view>
					<view>{{$t('mine.setting.modifyPwd')}}</view>
				</view>
			</view>
			<view class="list-cell list-cell-arrow" @click="handleToUpgrade">
				<view class="menu-item-box">
					<view class="iconfont icon-refresh menu-icon" style="color: #F6DDA4;"></view>
					<view>{{$t('mine.setting.checkVersion')}}</view>
				</view>
			</view>

		</view>
		<view class="cu-list menu">
			<view class="cu-item item-box">
				<view class="content text-center" @click="handleLogout">
					<text class="text-black">{{$t('mine.setting.out')}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				windowHeight: uni.getSystemInfoSync().windowHeight
			}
		},
		methods: {
			handleToPwd() {
				this.$tab.navigateTo('/pages/mine/pwd/index')
			},
			handleToUpgrade() {
				this.$modal.showToast(this.$t('mine.setting.newVersion'))
			},

			handleUpInfo() {
				this.$tab.navigateTo('/pages/mine/info/edit')
			},
			handleLogout() {
				this.$modal.confirm(this.$t('mine.outSystem')).then(() => {
					this.$store.dispatch('LogOut').then(() => {
						this.$tab.reLaunch('/pages/index')
					})
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: $uni-color-bg;
		color: white;
	}

	.menu-list {
		.list-cell {
			background-color: $uni-color-box;
			color: $uni-color-font;
		}
	}

	.cu-list {
		.item-box {
			background-color: $uni-color-primary;
			color: red;
			margin: 30rpx;
			display: flex;
			flex-direction: row;
			justify-content: center;
			align-items: center;
			padding: 10rpx;
			border-radius: 20px;
			font-size: 32rpx;
		}
	}
</style>